package com.Tjise.JAVAzuoye2;

public class HourEmployee extends ColaEmployee{
    double Hoursalary;
    int Hourmouth;

    public HourEmployee(String name, int birthday, double hoursalary, int hourmouth) {
        super(name, birthday);
        Hoursalary = hoursalary;
        Hourmouth = hourmouth;
    }

    @Override
    public double getSalary(int birthday) {
        if(super.getBirthday()==birthday) {
            if (Hourmouth>160) {
                return Hoursalary*160+Hoursalary*(Hourmouth-160)*1.5+100;
            }else {
                return Hoursalary*Hourmouth+100;
            }
        }else {
            if (Hourmouth>160) {
                return Hoursalary*160+Hoursalary*(Hourmouth-160)*1.5;
            }else {
                return Hoursalary*Hourmouth;
            }
        }
    }
}
